package com.seckill.search.service;

import com.seckill.goods.pojo.Sku;
import com.seckill.search.pojo.Page;
import com.seckill.search.pojo.SkuInfo;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/*****
 * @Author: http://www.itheima.com
 * @Project: seckillproject
 * @Description: com.seckill.search.service.SkuInfoService
 ****/
public interface SkuInfoService {

    /***
     * 秒杀商品搜索
     */
    Page<SkuInfo> search(Map<String, String> searchMap) throws IOException;

    /***
     * 增量操作  ->删除索引   type=3
     *           ->修改索引   type=2
     *           ->添加索引   type=1
     */
    void modify(Integer type, SkuInfo skuInfo);

    /***
     * 批量导入
     */
    void addAll() throws IOException;

    void deleteAll() throws IOException;

    /**
     * 添加数据到索引库
     */
    void importIndex(SkuInfo skuInfo) throws IOException;

    void createIndex(String indexName) throws IOException;

    void addIndex(Sku sku) throws IOException;

    void batchAddIndex(List<Sku> skus) throws IOException;


    void clear() throws IOException;

    void deleteById(String id) throws IOException;
}
